Custom bioses for QEMU & UEFI
Home About Projects Blog Games Contact Support!! NOTE !!: This assumes you are using an Ubuntu Linux host to build; I could not get EDKII to build on Alpine Linux.
$ sudo apt-get install build-essential git uuid-dev iasl nasm
$ git clone https://github.com/tianocore/edk2
$ cd edk2
$ git submodule update --init
$ source edksetup.sh
$ make -C BaseTools/
C:\nasm
C:\ASL
vs_BuildTools.exe
start /WAIT vs_BuildTools.exe --quiet --wait --nocache --norestart --installPath C:\BuildTools ^
--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^
--add Microsoft.VisualStudio.Component.Windows11SDK.26100 ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64
C:\BuildTools\VC\Auxiliary\Build\vcvars32.batC:\BuildTools\VC\Auxiliary\Build\vcvars64.batset BASETOOLS_MINGW_PATH=C:\MinGWFor X86_64:
build -a X64 -t GCC -b RELEASE -p OvmfPkg/OvmfPkgX64.dscbuild -a X64 -t VS2022 -b RELEASE -p OvmfPkg/OvmfPkgX64.dscbuild -a X64 -t CLANGPDB -b RELEASE -p OvmfPkg/OvmfPkgX64.dscbuild -a X64 -t CLANGDWARF -b RELEASE -p OvmfPkg/OvmfPkgX64.dscor
edit file Conf/target.txt: change values for ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc, TARGET = RELEASE, TARGET_ARCH = X64, TOOL_CHAIN_TAG = VS2022
then run build
Final output files should be in Build/OvmfPkgX64/RELEASE_GCC/FV/, where RELEASE_GCC matches the e.g. -b RELEASE and -t GCC flags
Edit files OvmfPkg/OvmfPkgX64.dsc and OvmfPkg/OvmfPkgX64.fdf
For example, to add USB Mouse drivers for "Simple Pointer Protocol" and/or "Absolute Pointer Protocol".
! NOTE !: While you can add both simple and absolute pointer protocols, building with both usually has the
Simple Pointer protocol "overwrite" the absolute pointer protocol for USB mouse devices.
I recommend using one or the other, or building 2 separate OVMF.fd files, 1 for Simple Pointer, and 1 for
Absolute Pointer.
Simple Pointer Protocol:
MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf to OvmfPkg/OvmfPkgX64.dsc under the "Usb Support" section.INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf to OvmfPkg/OvmfPkgX64.fdf under the "Usb Support" section.Absolute Pointer Protocol:
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf to OvmfPkg/OvmfPkgX64.dsc under the "Usb Support" section.INF MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf to OvmfPkg/OvmfPkgX64.fdf under the "Usb Support" section.